<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
    <table>
        <tbody>
        <volist name="userList" id="list">
            <tr data-id="{$list['id']}">
                <td class="sign">
                    <div style="width: 24px;"><i class="ico-check"></i></div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 100px;">{$list.id}</div>
                </td>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 180px;">{$list.name}</div>
                </td>
                 <td align="left" class="">
                    <div style="text-align: center; width: 180px;">{$list.phone}</div>
                </td>
                 <td align="left" class="">
                    <div style="text-align: center; width: 180px;"><img src="/public/upload/pic/{$list.pic}" style="width: 50px;height: 50px;"></div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 180px;">{$list.address}</div>
                </td>
                 <td align="left" class="">
                    <div style="text-align: center; width: 180px;">{$list.aname}</div>
                </td>
                 <td align="left" class="">
                  <div style="text-align: center; width: 180px;">
                    <if condition='$list[status] eq 1'>
                      <span class="yes" onClick="changeTableVal('visitors','id','{$list.id}','status',this)" ><i class="fa fa-check-circle"></i>是</span>
                      <else />
                      <span class="no" onClick="changeTableVal('visitors','id','{$list.id}','status',this)" ><i class="fa fa-ban"></i>否</span>
                    </if>
                  </div>
                </td>       
                <td align="center" class="handle">
                    <div style="text-align: center; width: 150px; max-width:250px;">
                        <a class="btn blue" href="{:U('Admin/auth/add_visitors',array('id'=>$list['id']))}"><i class="fa fa-pencil-square-o"></i>详情</a>
                        <a class="btn blue" href="{:U('Admin/auth/del_visitors',array('id'=>$list['id']))}"><i class="fa fa-pencil-square-o"></i>删除</a>
                    </div>
                </td>
                <td align="" class="" style="width: 100%;">
                    <div>&nbsp;</div>
                </td>
            </tr>
        </volist>
        </tbody>
    </table>
</div>
<!--分页位置-->
{$page}
<script>
    $(".pagination  a").click(function(){
        var page = $(this).data('p');
        ajax_get_table('search-form2',page);
    });
    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid >table>tbody>tr').click(function(){
            $(this).toggleClass('trSelected');
        });
        $('#user_count').empty().html("{$pager->totalRows}");
    });
    function delfun(obj) {
        // 删除按钮
        layer.confirm('确认删除？', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data: {id : $(obj).attr('data-id')},
                dataType: 'json',
                success: function (data) {
                    layer.closeAll();
                    if (data.status == 1) {
                        $(obj).parent().parent().parent().remove();
                    } else {
                        layer.alert(data.msg, {icon: 2});
                    }
                }
            })
        }, function () {
        });
    }
</script>